
package com.fy.tt.executor.node.sentence.simpleStmt;


import com.fy.tt.executor.environment.Environment;
import com.fy.tt.executor.node.element.Predicate;
import com.fy.tt.executor.node.element.Subject;
import com.fy.tt.executor.node.script.SimpleStmt;

public class SubPre extends SimpleStmt {

    public Subject subject;
    public Predicate predicate;


    @Override
    public boolean run(String methodName) {
        System.out.println("主谓句！");
        System.out.println("主语："+subject.identifier.text);
        System.out.println("谓语："+predicate.verb.text);
        boolean res = true;
        if (subject != null){
            Environment.environment.put(new String(subject.identifier.text),subject.identifier.text);
            res = subject.run(methodName);
        }
        if (res){
            //Environment.environment.put(predicate.verb.text);
            res = predicate.run(methodName);
        }

        return res;
    }
}
